<template>
	<view class="contain col">
		<div style="height: 44px; background: #FFCA0A;"></div>
		<web-view :webview-styles="webviewStyles" :src="url" @message="postMessage" style="position: absolute;top: 44px;"></web-view>
	</view>
</template>

<script>
	import { BASE_IMAGE_URL } from '@/utils/api'
	import { setTitleColor } from '@/utils/index.js'
	export default {
		data() {
			return {
				webviewStyles: {
                    progress: {
                        color: '#FF3333'
                    }
                },
				url: ''
			}
		},
		methods: {
			postMessage(evt){
				console.log('接收到的消息：' + JSON.stringify(evt));
			},
			updateQueryStringParameter(uri, key, value) {
				if(value){
					if(uri.indexOf("?") != -1){
						uri = uri+"&"+key+"="+value
					}else{
						uri = uri+"?"+key+"="+value
					}
				}
				return uri;
			}
		},
		onShow(){
		},
		// https://uniapp.dcloud.io/static/web-view.html   http://www.91fld.com/fanli/first/15852.html
		onLoad(opt){
			this.url = "http://www.91fld.com/wallet?auth_token="+uni.getStorageSync("auth_token")+"&tpjk_app_version="+uni.getStorageSync("tpjk_app_version");
			// this.url = "http://www.91fld.com/wallet";
			// this.url = this.updateQueryStringParameter(this.url, "auth_token", uni.getStorageSync("auth_token") )
			console.log(this.url);
			
			setTitleColor();
			
		},
		onNavigationBarButtonTap:function(e){
			uni.navigateTo({
				url: '/pages/home_webview/home_webview?url=http://www.91fld.com/wallet/fundRecord/index'
			});
		},
		onBackPress() {
			console.log("999900088888");
		}
	}
</script>

<style>
.contain{overflow: auto; background: #FFFFFF;}
</style>
